<template>
	<view>
		<view class="container">
			<view class="line">
				<view class="sub-title">公司全称/个体经营户</view>
				<view class="input-wrapper" :class="{ 'border-light': isFocus === 1 }">
					<view class="uni-input">{{ companyName }}</view>
				</view>
			</view>
			<view class="line">
				<view class="sub-title" v-if="stateSmallTitle">认证类型</view>
				<view class="input-wrapper" :class="{ 'border-light': isFocus === 2 }" @click="openPicker">
					<view :class="{ 'uni-input': typename, 'input-palceholder': !typename }">{{ typename ? typename : '认证类型' }}</view>
					<u-picker
            mode="selector"
            v-model="typeshow"
            :default-selector="[0]"
            :range="selector"
            confirm-color="#FBB000"
            range-key="name"
            @confirm="confirm"
          ></u-picker>
			
					<view class="right-icon"><u-icon name="arrow-down-fill" color="#e1e1e1" size="20rpx"></u-icon></view>
				</view>
			</view>
			<view class="line" v-if="!isCarwash">
				<view class="input-wrapper" :class="{ 'border-light': isFocus === 3 }">
					<view :class="{ 'uni-input': isOwner, 'input-palceholder': !isOwner }">我是法人</view>
					<view class="right-icon"><u-switch v-model="isOwner" active-color="#41CB05" size="40" @change="switchChange"></u-switch></view>
				</view>
			</view>
			<view class="line" >
				<view class="sub-title" v-if="telSmallTitle">{{isCarwash?'':'法人'}}手机号</view>
				<view class="input-wrapper" :class="{ 'border-light': isFocus === 4 }">
					<input
						class="uni-input"
						ref="telInput"
						type="number"
						:placeholder="telSmallTitle?'':telPlaceholder"
						v-model="mobile"
						placeholder-style="font-size:34rpx;font-weight:blod;color:#999"
						maxlength="11"
						@focus="telFocus"
						@blur="telBlur"
					/>
					<view class="del-icon" @click="clearIcon" v-if="telClearIcon"><i-icon icon="iconquxiaoxunjia" type="single" size="34rpx" color="#e1e1e1"></i-icon></view>
				</view>
			</view>
			<view class="img-wrapper">
				<view class="img-inner">
					<view :class="[notCompanyName?'borderEB5C02':'' ,'img']" @click="uploadImage(0)">
						<!-- <image v-if="imgurl == ''" src="../../static/img/user/zhizhao.png" mode="widthFix"></image> -->
						<image  :src="imgurl?imgurl:'../../static/img/user/zhizhao.png'" mode="aspectFill"></image>
						<i-icon class="icon-sel" v-if="!imgurl" icon="iconpaishe_1" type="multiple" size="67rpx"></i-icon>
					</view>
					<view class="img-text">营业执照</view>
				</view>
				<template v-if="!isCarwash">
				<view class="img-inner" v-show="!isOwner">
					<view :class="[notFace?'borderEB5C02':'' ,'img']" @click="uploadImage(1)">
						<image v-if="faceimg == ''" src="../../static/img/user/id-zheng.png" mode="widthFix"></image>
						<image v-else :src="faceimg" mode="aspectFill"></image>
						<i-icon class="icon-sel" icon="iconpaishe_1" type="multiple" size="67rpx"></i-icon>
					</view>
					<view class="img-text">法人身份证人像面</view>
				</view>
				<view class="img-inner" v-show="!isOwner">
					<view :class="[notBack?'borderEB5C02':'' ,'img']" @click="uploadImage(2)">
						<image v-if="backimg == ''" src="../../static/img/user/id-fan.png" mode="widthFix"></image>
						<image v-else :src="backimg" mode="aspectFill"></image>
						<i-icon class="icon-sel" icon="iconpaishe_1" type="multiple" size="67rpx"></i-icon>
					</view>
					<view class="img-text">法人身份证国徽面</view>
				</view>
				</template>
			</view>
			<view class="tip" v-if="notCompanyName || notFace || notBack">
				*识别失败，请重新上传
			</view>
			<view class="btn">
				<view class="tips">
					<view class="text">我们将严格保密您提交的信息</view>
					<view class="text">
						如有问题请联系客服：
						<text class="orange" @click="callPhone()">{{ servicePhone }}</text>
					</view>
				</view>
				<button :class="isDisabled ? 'btn-dis' : 'btn-commit'" @click="$u.throttle(companyIdentity, 3000)">提交</button>
			</view>

			<!-- 弹窗 -->
			<uni-popup ref="popup" type="center" class="popup">
				<view class="popup-content">
					<view class="popup-main">
						<view class="icon"><i-icon icon="icontishi" type="single" size="127rpx" color="#f0ad4e"></i-icon></view>
					</view>
					<view class="popup-title">认证提示</view>
					<view class="tips">您上传的营业执照信息，与账号 注册时填写的企业名称不一致， 请确认是否以当前信息为准。</view>
					<view class="popup-footer">
						<button class="disagreeBtn" @click="resetImg">重新上传</button>
						<button class="agreeBtn" @click="confirmImg">确认</button>
					</view>
				</view>
			</uni-popup>
		<!-- 	<u-popup v-model="typeshow" border-radius="30" mode="bottom"  >
				<view class="popupWrap">
					<view class="listItem color-333 font-34">公司类型</view>
					<view class="listItem color-666 font-28" @click="confirm(i)" v-for="(it, i) in selector" :key="i" :style="i === 1 || i === 2 ? 'line-height:78rpx' : ''">{{ it.name }}</view>
				</view>
			</u-popup> -->
		</view>
	</view>
</template>

<script src="./authenticationCompany.js"></script>
<style src="./authenticationCompany.scss" lang="scss"></style>
